home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / prtgrid / prtdemo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  3.0 KB  |  104 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "PrintGrid Demo"
  5.    ClientHeight    =   4035
  6.    ClientLeft      =   2115
  7.    ClientTop       =   1995
  8.    ClientWidth     =   4635
  9.    Height          =   4725
  10.    Icon            =   PRTDEMO.FRX:0000
  11.    Left            =   2055
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   4035
  15.    ScaleWidth      =   4635
  16.    Top             =   1365
  17.    Width           =   4755
  18.    Begin Grid grdDemo 
  19.       Cols            =   5
  20.       Height          =   3375
  21.       Left            =   180
  22.       Rows            =   15
  23.       TabIndex        =   0
  24.       Top             =   180
  25.       Width           =   4275
  26.    End
  27.    Begin Label lbl1 
  28.       Caption         =   "Press Ctrl+P to Print"
  29.       Height          =   195
  30.       Left            =   180
  31.       TabIndex        =   1
  32.       Top             =   3660
  33.       Width           =   1875
  34.    End
  35.    Begin Menu mnuFile 
  36.       Caption         =   "&File"
  37.       Begin Menu mnuFilePrint 
  38.          Caption         =   "&Print"
  39.          Shortcut        =   ^P
  40.       End
  41.       Begin Menu mnuFileSep1 
  42.          Caption         =   "-"
  43.       End
  44.       Begin Menu mnuFileExit 
  45.          Caption         =   "E&xit"
  46.       End
  47.    End
  48.    Begin Menu mnuFileAbout 
  49.       Caption         =   "&About"
  50.       Begin Menu mnuAboutText 
  51.          Caption         =   " "
  52.          Index           =   0
  53.       End
  54.       Begin Menu mnuAboutText 
  55.          Caption         =   "Distributed Freely by"
  56.          Index           =   1
  57.       End
  58.       Begin Menu mnuAboutText 
  59.          Caption         =   "New Leaf Software"
  60.          Index           =   2
  61.       End
  62.       Begin Menu mnuAboutText 
  63.          Caption         =   "(New Leaf@aol.com)"
  64.          Index           =   3
  65.       End
  66.       Begin Menu mnuAboutText 
  67.          Caption         =   " "
  68.          Index           =   4
  69.       End
  70.    End
  71. Option Explicit
  72. Sub Form_Load ()
  73.     Dim RowIndex As Integer
  74.     Dim ColIndex As Integer
  75.     ' populate grid with sample data
  76.     For RowIndex = 0 To grdDemo.Rows - 1
  77.         grdDemo.Row = RowIndex
  78.         For ColIndex = 0 To grdDemo.Cols - 1
  79.             grdDemo.Col = ColIndex
  80.             grdDemo.Text = String$(RowIndex + 1, Right(ColIndex, 1)) & " " & String$(RowIndex + 1, Right(ColIndex, 1))
  81.         Next
  82.     Next
  83. End Sub
  84. Sub mnuFileExit_Click ()
  85.     Unload Me
  86. End Sub
  87. Sub mnuFilePrint_Click ()
  88.     '
  89.     ' initialize PageInfo prior to calling PrintGrid
  90.     '
  91.     ' 1440 twips = 1 inch
  92.     PageInfo.Margin = 1440
  93.     ' must be a Printer supported font (TrueType works best)
  94.     PageInfo.FontName = "Arial"
  95.     PageInfo.FontSize = 10
  96.     PageInfo.FontBold = True
  97.     PageInfo.FontItalic = False
  98.     ' shading for fixed rows/cols: 0 (none) to 255 (black)
  99.     PageInfo.FixedShade = 224
  100.     Screen.MousePointer = 11
  101.     PrintGrid grdDemo
  102.     Screen.MousePointer = 0
  103. End Sub
  104.